<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../css/index.css" />
<link rel="stylesheet" type="text/css" href="../../js/myPagination/page.css" />
<link rel="stylesheet" type="text/css" href="../../jeasyui/themes/gray/easyui.css" />
<link rel="stylesheet" type="text/css" href="../../jeasyui/themes/icon.css" />


<script type="text/javascript" src="../../jeasyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../../js/myPagination/jquery.myPagination6.0.js"></script>
<script type="text/javascript" src="../../js/jquery-jtemplates.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript" src="../../jeasyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../jeasyui/locale/easyui-lang-zh_CN.js"></script>
<title>主页</title>
<style type="text/css">
	.oneArticle{
		border-bottom: 1px solid #EFF0F1;
		margin-bottom: 10px;
	}
	.oneArticle .category{
		color: #999;
	}
	.oneArticle .title{
		font-weight: 600;
	}
	.oneArticle .content{
		padding: 0 10px;
	}

	.oneArticle .opt{
		margin: 0;
		padding: 0;
		text-align: right;
		padding-right: 5px;
		color: #666;
	}
	#main h2 a#writleArticle{
		background: none;
		color: #666;
		text-decoration: none;
		line-height:25px;
		float:right;
		display:inline-block;
		font-size: 14px;
	}

</style>
<script type="text/javascript">
var page;

function queryMyArticles(){
	page = initPagination({'pageId':'pageDiv', 
					'url' : 'article.do?method=findUserArticles', 
					'callback':function(data){
						$("#myArticles").setTemplateElement("tpl-article",null, {filter_data:false});
						$("#myArticles").processTemplate(data.rows);
					}});
}

function deleteArticle(id){
	confirmDo('删除提示','您确定删除该文章吗？', function(){
		$.post("article.do",{id:id, method:"deleteArticle"}, function(){
			page.onReload();
		});
	});
}


$(function(){
	queryMyArticles();
});
</script>
</head>

<body>
<!-- wrap starts here -->
<div id="wrap">
		
		<!--header -->
		<div id="header">			
				
			<h1 id="logo-text"><a href="#">Siloam</a></h1>		
			<p id="slogan">Here am I. Send me!</p>		
			
			<div id="header-links">
			<p>
				<a href="index.html">后台</a> | 
				<a href="index.html">退出</a>			
			</p>		
		</div>		
						
		</div>
		
		<!-- menu -->	
		<div  id="menu">
			<ul>
				<li ><a href="#">首页</a></li>
				<li><a href="#">团契介绍</a></li>
				<li><a href="#">联系我们</a></li>
				<li id="current"><a href="#">个人中心</a></li>
			</ul>
		</div>					
			
		<!-- content-wrap starts here -->
		<div id="content-wrap">
				
			<div id="sidebar">
			
				<h3>功能列表</h3>
				<ul class="sidemenu">				
					<li><a href="#">团契动态</a></li>
					<li><a href="#">我的代祷</a></li>
					<li><a href="#">我的文章</a></li>
					<li><a href="#">我的小组</a></li>
					<li><a href="#" title="Web Templates">密码修改</a></li>
				</ul>
								
			</div>
				
			<div id="main">
				<h2>我的文章<a href="writeArticle.jsp" id="writleArticle">写文章</a></h2>
				<div id="myArticles">
				
				</div>
				<div id="pageDiv"></div>
			</div>
		
		<!-- content-wrap ends here -->	
		</div>
					
		<!--footer starts here-->
		<div id="footer">
            <p>&copy; 2013 <strong>copyright siloam</strong>
   	    </p>
				
		</div>	

<!-- wrap ends here -->
</div>

<!-- 模版 -->
<p style="display: none">
  		
<!-- 评论模版 -->
<textarea id="tpl-article" rows="0" cols="0">
<!--
{#foreach $T as row}
<div class="oneArticle">
	<p>
		<span class="category">[{$T.row.articleCategory.name}]</span>
		<span class="title">
			<a href="article.do?method=loadArticle&id={{$T.row.id}}">{$T.row.title}</a>
		</span>
	</p>
	<div class="content">
		{$T.row.content}
	</div>
	<p class="opt">
		<span>{$T.row.date}</span>
		<a href="article.do?method=initEditArticle&id={$T.row.id}">编辑</a>
		<a href="javascript:deleteArticle({$T.row.id})">删除</a>
	</p>
</div>
{#/for}
-->
</textarea>
 		
</p>

</body>
</html>
